from rest_framework import serializers
from .models import Movie,Category
# class MovieListSerializer(serializers.Serializer):
    
#     id = serializers.IntegerField(read_only = True)     
#     movie_name = serializers.CharField(max_length = 100)


# 显示全部信息
# class MovieListSerializer(serializers.ModelSerializer):
    
#     class Meta:
#         model = Movie
#         fields = "__all__"


# class MovieDetailSerializer(serializers.ModelSerializer):
    
#     class Meta:
#         model = Movie
#         fields = "__all__"


class MovieSerializer(serializers.ModelSerializer):
    
    class Meta:
        model = Movie
        fields = "__all__"



class CategorySerializer(serializers.ModelSerializer):
    class Meta:
        model = Category
        fields = "__all__"
